<?php

	
	function readCounter(){
		$FILENAME = "counter.dat";
		$handle = fopen( $FILENAME , "r");
		$count = fscanf($handle, "%d");
		fclose($handle);
		return $count[0];
	}

	function addCounter(){
		$FILENAME = "counter.dat";
		$handle = fopen( $FILENAME , "r");
		$count = fscanf($handle, "%d");
		$count = $count[0];
		fclose($handle);
		$handle = fopen( $FILENAME , "w");
		$count++;
		fwrite($handle, $count);
		fflush($handle);
		fclose($handle);
	}
?>
